package com.deyuanyun.pic.pbf.controller.dto.defect.node;

import com.deyuanyun.pic.common.util.ObjectUtil;
import com.deyuanyun.pic.common.util.format.NumberFormat;
import com.deyuanyun.pic.pbf.domain.CoatRepair;
import com.deyuanyun.pic.settings.support.biz.CodeUtil;

/**
 * 8,防腐层修复表
 *
 * @author huanglw
 * @date 2016-7-5
 *
 * History: [修改人][时间][修改描述]
 */
public class CoatRepairDto extends NodeDto {

    /**
     * 是否为补口：是，否
     */
    private String isJoint;

    /**
     * 管表温度（℃）
     */
    private String surfaceTemperature;

    /**
     * 环境温度（℃）
     */
    private String environmentalTemperature;

    /**
     * 修复材料：粘弹体+压敏胶热收缩带；粘弹体+外保护带；粘弹体+热收缩带/套；压敏胶热收缩带；热收缩带/套；无溶剂环氧；聚氨酯；聚乙烯冷缠胶带；聚丙烯冷缠胶带；热熔胶+补伤片；粘弹体+补伤片；其他；未知
     */
    private String repairMaterial;

    /**
     * 修复长度
     */
    private String repairLength;

    /**
     * 厚度（mm）
     */
    private String repairThickness;

    /**
     * 工作量
     */
    private String workload;

    /**
     * 修复材料厂商
     */
    private String materialManufacturer;

    /**
     * 电火花检漏(电压)
     */
    private String edmLeak;

    /**
     * 是否完成该节点任务：0，没有完成；1，已经完成
     */
    private Short isCompletion;

    public CoatRepairDto(Short isCompletion) {
        this.isCompletion = isCompletion;
    }

    public Short getIsCompletion() {
        return isCompletion;
    }

    public void setIsCompletion(Short isCompletion) {
        this.isCompletion = isCompletion;
    }

    public String getIsJoint() {
        return isJoint;
    }

    public void setIsJoint(String isJoint) {
        this.isJoint = isJoint;
    }

    public String getSurfaceTemperature() {
        return surfaceTemperature;
    }

    public void setSurfaceTemperature(String surfaceTemperature) {
        this.surfaceTemperature = surfaceTemperature;
    }

    public String getEnvironmentalTemperature() {
        return environmentalTemperature;
    }

    public void setEnvironmentalTemperature(String environmentalTemperature) {
        this.environmentalTemperature = environmentalTemperature;
    }

    public String getRepairMaterial() {
        return repairMaterial;
    }

    public void setRepairMaterial(String repairMaterial) {
        this.repairMaterial = repairMaterial;
    }

    public String getRepairLength() {
        return repairLength;
    }

    public void setRepairLength(String repairLength) {
        this.repairLength = repairLength;
    }

    public String getRepairThickness() {
        return repairThickness;
    }

    public void setRepairThickness(String repairThickness) {
        this.repairThickness = repairThickness;
    }

    public String getWorkload() {
        return workload;
    }

    public void setWorkload(String workload) {
        this.workload = workload;
    }

    public String getMaterialManufacturer() {
        return materialManufacturer;
    }

    public void setMaterialManufacturer(String materialManufacturer) {
        this.materialManufacturer = materialManufacturer;
    }

    public String getEdmLeak() {
        return edmLeak;
    }

    public void setEdmLeak(String edmLeak) {
        this.edmLeak = edmLeak;
    }

    public void fromDomain(CoatRepair domain) {

        if (ObjectUtil.isEmptyAll(domain)) {
            return;
        }

        // 是否为补口：是，否
        this.isJoint = CodeUtil.getName(domain.getIsJoint());
        // 管表温度（℃）
        this.surfaceTemperature = NumberFormat.format(domain.getSurfaceTemperature());
        // 环境温度（℃）
        this.environmentalTemperature = NumberFormat.format(domain.getEnvironmentalTemperature());
        // 修复材料
        this.repairMaterial = CodeUtil.getName(domain.getRepairMaterial());
        // 修复材料厂商
        this.materialManufacturer = domain.getMaterialManufacturer();
        // 修复长度
        this.repairLength = NumberFormat.format(domain.getRepairLength());
        // 工作量
        this.workload = domain.getWorkload();
        // 厚度（mm）
        this.repairThickness = NumberFormat.format(domain.getRepairThickness());
        // 电火花检漏(电压)
        this.edmLeak = NumberFormat.format(domain.getEdmLeak());

        // 赋值
        super.fromDomain(domain.getId(), domain.getCreateRemark());
    }
}